{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group fl">
            <a href="{:url('admin/leave/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加</a>
        </div>
        <div class="layui-btn-group fl">
        </div>
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>班级</th>
                <th>理由</th>
                <th>类型</th>
                <th>起始时间</th>
                <th>结束时间</th>
                <th>销假时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="v" empty="$empty"}
            <tr>
                <td>{$page*10+$key+1}</td>
                <td>{$v.name}</td>
                <td>{$v.getgrade.title }</td>
                <td>{$v.reason}</td>
                <td>{if $v.type eq 1}长假{else}短假{/if}</td>
                <td>{$v.starting_time}</td>
                <td>{$v.finish_time}</td>
                <td>{if $v.report_time eq ''}未销假{else}{$v.report_time}{/if}</td>
                <td>{if $v.report_time eq ''}进行中{else}已完成{/if}</td>
                <td>
                    <input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('admin/leave/teacherstatus', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
                    <a href="{:url('admin/leave/edit',['id' => $v.id])}">编辑</a>
                    <a href="{:url('admin/leave/report_time',['id' => $v.id])}">销假</a>
                    <a href="{:url('admin/leave/del',['id' => $v.id])}">删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        <div class="page">{$list->render()}</div>
    </div>
</div>
{/block}
